/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.oracleandsxnd.erp.member.web;

import com.oracleandsxnd.erp.common.persistence.Page;
import com.oracleandsxnd.erp.common.persistence.TableSplitResult;
import com.oracleandsxnd.erp.common.web.AjaxResult;
import com.oracleandsxnd.erp.common.web.BaseController;
import com.oracleandsxnd.erp.member.entity.MemberIntegralRule;
import com.oracleandsxnd.erp.member.service.MemberIntegralRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 会员积分规则管理Controller
 * @author 会员积分规则管理
 * @version 2019-12-13
 */
@Controller
@RequestMapping(value = "member_memberIntegralRule")
public class MemberIntegralRuleController extends BaseController {

	@Autowired
	private MemberIntegralRuleService memberIntegralRuleService;

	@RequestMapping(value = {""})
	public String list() {
		return "erp/member/memberIntegralRuleList";
	}
	@RequestMapping(value = {"listData"})
	@ResponseBody
	public Object listData(MemberIntegralRule memberIntegralRule , HttpServletRequest request, HttpServletResponse response){
		Page<MemberIntegralRule> page = memberIntegralRuleService.findPage(new Page<MemberIntegralRule>(request, response), memberIntegralRule);
		TableSplitResult<MemberIntegralRule> result=new TableSplitResult<MemberIntegralRule>(page.getPageNo(), page.getCount(), page.getList());
		return  result;
	}
	@RequestMapping(value = "save")
	@ResponseBody
	public AjaxResult save(MemberIntegralRule memberIntegralRule) {

		memberIntegralRuleService.save(memberIntegralRule);
		return success();
	}

	@RequestMapping(value = "delete")
	@ResponseBody
	public AjaxResult  delete(MemberIntegralRule memberIntegralRule, RedirectAttributes redirectAttributes) {
		memberIntegralRuleService.delete(memberIntegralRule);
		return success();
	}
	



}